/*
 * @Author: greyqiu greyqiu@163.com
 * @Date: 2025-03-12 17:07:30
 * @LastEditors: greyqiu greyqiu@163.com
 * @LastEditTime: 2025-03-18 11:41:20
 * @Description: 
 * Copyright (c) 2025 by ${greyqiu}, All Rights Reserved. 
 */


#ifndef APP_COMM_COM_REGISTER_H_
#define APP_COMM_COM_REGISTER_H_

#include "stdint.h"

#define     MSG_ORIADDR         0
#define     TEST_ORIADDR        1
#define     PAR_ORIADDR         2
#define     CMD_ORIADDR         3
#define     OTA_ORIADDR         4

enum DSP_REG
{
    MSG_SIZE = 8
};

// 16位寄存器类型定义
typedef union {
    int16_t i16;
    uint16_t u16;
} Reg16;

// 32位寄存器类型定义
typedef union {
    int32_t i32;
    uint32_t u32;
    float f32;
    struct {
        uint16_t u16h;
        uint16_t u16l;
    };
} Reg32;

extern Reg16 dspReg[MSG_SIZE];
extern Reg16 bmsStateReg[8];
void msgRegInit(void);
void msgRegUpdata(void);
void testRegInit(void);
void parRegInit(void);

#endif /* APP_COMM_COM_REGISTER_H_ */
